package spring.lottery.server.mq;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import spring.lottery.server.DlxReceiver;

import static spring.lottery.common.config.DirectRabbitConfig.DLX_QUEUE_NAME;

/**
 * 这个是处理死信队列
 */
@Slf4j
@Component
@RabbitListener(queues = DLX_QUEUE_NAME)
public class DlxReceiverImp implements DlxReceiver {

    @RabbitHandler
    public void receive(String message) {
        log.info("开始处理异常消息");
        log.info("收到的异常消息  {}", message);
    }
}
